<?php

echo "<b>Shoutbox</b>";

if(!isset($_GET['page'])){ 
    $page = 1; 
} else { 
    $page = $_GET['page']; 
}  

$result=mysql_query("select * from members where username='$username' and password='$password'");

$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
	include("check.inc.php");
}
if ($ok>0)
{
        include("smilies.inc.php");

}

$max_results = 1; 
$from = (($page * $max_results) - $max_results);  


$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM shoutmsgs"),0); 
$total_pages = ceil($total_results / $max_results); 


$sql = mysql_query("SELECT * FROM shoutmsgs  ORDER BY id desc LIMIT $from, $max_results"); 
while($row = mysql_fetch_array($sql)){ 
$name = $row['name'];
$msg = $row['msg'];
$key = $row['id'];
include 'str_replace.php';
echo "<br/><a href=\"profile.php?username=$username&amp;password=$password&amp;name=$name\"><small><b>*$name*</b><br/>$msg</small><br/></a>";



echo "<small><br/><b><a href=\"poster.php?key=$key\">$name</a></b><br/>$msg</small><br/>" ;




}
echo "<small><a href=\"add.php\">Shout</a></small>";
echo"_";
echo "<small><a href=\"history.php\">History</a></small>";
?>